package com.agnes.network.observer;

import com.agnes.network.callback.RespCallback;
import com.orhanobut.logger.Logger;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.CompositeDisposable;

/**
 * Desc:
 * Creator ling
 * Date:   2017/9/28 0028 14:38
 */

public abstract class ApiObserver<D> extends BaseObserver<D, String> {

    public ApiObserver(RespCallback<D> responseCallback, CompositeDisposable compositeDisposable) {
        super(responseCallback, compositeDisposable);
    }

    @Override
    public void onNext(@NonNull String result) {
        Logger.e("result ==>>" + result);
        onSuccess(result);
    }

    public abstract void onSuccess(String response);
}
